USE BishoyPhoto
GO

CREATE PROC AddContact (@Name AS varchar(100), @Email varchar(40), @Mobile varchar(20))
AS
INSERT INTO [dbo].[Contact]
      ([Name]
      ,[Email]
      ,[Mobile])
  VALUES
      (@Name
      ,@Email
      ,@Mobile)
GO

CREATE PROC UpdateContact (@ID int, @Name AS varchar(100), @Email varchar(40), @Mobile varchar(20))
AS
      IF @Name IS NOT NULL BEGIN UPDATE [dbo].[Contact] SET [Name] = @Name WHERE ID = @ID END
      IF @Email IS NOT NULL BEGIN UPDATE [dbo].[Contact] SET [Email] = @Email WHERE ID = @ID END
      IF @Mobile IS NOT NULL BEGIN UPDATE [dbo].[Contact] SET [Mobile] = @Mobile WHERE ID = @ID END
GO

CREATE PROC DeleteContact (@ID int)
AS
DELETE FROM [dbo].[Contact] WHERE ID = @ID
GO
